package com.sishu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sishu.pojo.Gamegroups;
import com.sishu.pojo.TeamStudent;
import com.sishu.pojo.dto.Studentdto;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


public interface GamegroupsMapper extends BaseMapper<Gamegroups> {


    @Select("SELECT * FROM gamegroups WHERE game_id = #{gameId} and active = 0")
    List<Gamegroups> selectbygameId(String gameId);

    @Select("SELECT * FROM gamegroups WHERE group_id = #{groupId}")
    Gamegroups selectbygroupId(String groupId);

    @Update("UPDATE gamegroups SET active = 1 where group_id = #{groupId}")
    void setactiveone(String groupId);

    @Select("select count(*) from student where s_id=#{sId}")
    int checkstudent(Studentdto student);

    @Select("select count(*) from student where s_id=#{sId}")
    int checkteamstudent(TeamStudent student);


}
